using System;
using System.Collections.Generic;
using System.Text;
using System.Web.UI;

namespace Pampa.WebControls
{
    public class ClientButton : Button
    {
        string methodName;

        #region Constructores

        public ClientButton() : base()
        {

        }

        public ClientButton(string ID, ButtonType type, string methodName) : base(ID, type)
        {
            this.methodName = methodName;
        }

        #endregion

        #region Properties

        public virtual string MethodName
        {
            get { return methodName; }
            set { methodName = value; }
        }

        #endregion

        #region Render

        protected override void Render(HtmlTextWriter writer)
        {
            base.Render(writer);
        }

        #endregion

        #region Protected Functions

        protected override string GetMethod()
        {
            string functionDef = methodName;
            if (!string.IsNullOrEmpty(functionDef))
            {
                if (functionDef.IndexOf("(") == -1)
                    functionDef = functionDef + "()";
                if (functionDef.IndexOf(";") == -1)
                    functionDef = functionDef + ";";
            }
            return functionDef;
        }

        #endregion

    }
}
